import 'package:flutter/material.dart';

import '../const.dart';

class MainPage extends StatefulWidget {
  @override
  _MainPageState createState() => _MainPageState();
}

class _MainPageState extends State<MainPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      floatingActionButton: Padding(
        padding: const EdgeInsets.symmetric(vertical: 72, horizontal: 20),
        child: IconButton(
          onPressed: () {},
          iconSize: 88,
          icon: Image.asset('images/home_btn_record.png'),
        ),
      ),
      appBar: AppBar(
        title: Text(
          '图传系统',
          style: TextStyle(fontSize: 18),
        ),
        actions: <Widget>[
          IconButton(
            icon: Image.asset(
              'images/home_btn_set_up.png',
              scale: 3,
            ),
            onPressed: () {},
          ),
        ],
      ),
      body: NullContainer(),
    );
  }
}

class NullContainer extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        children: <Widget>[
          SizedBox(
            height: 134,
          ),
          Image.asset(
            'images/home_pic_nothing.png',
            scale: 3,
          ),
          SizedBox(
            height: 20,
          ),
          Text(
            '暂无视频信息\n点击录屏开始录制',
            style: TextStyle(color: Const.gray, fontSize: 16),
            textAlign: TextAlign.center,
          )
        ],
      ),
    );
  }
}
